<template>
	<div><h1>B组件</h1></div>
	{{ s }}
</template>

<!-- 兄弟传值子A==>父亲==>子B -->
<!-- <script setup>
const props = defineProps({
	str: {
		type: String,
		default: '123'
	}
});

</script> -->

<!-- 兄弟直接传值 -->
<script setup>
import mitt from '@/plugins/Bus.js';
let s = ref('');
onBeforeMount(() => {
	mitt.on('fn', e => {
		s.value = e.value;
		console.log(s.value);
	});
});
</script>
<style></style>
